bitbake extremely slow down during "Initialising tasks" #bitbake #scarthgap
Hi,
I use scarthgap release for several ARM boards eg.: AMD ZynqMP and NXP i.MX. I use Ubuntu 22.04 with the latest updates but after an Ubuntu update and reboot, from one day to the other bitbake slowed down extremely. "Initialising tasks" operates in slowly then after it only 4-5 tasks willing to start and work in parallel even though there was worked in 20 parallel tasks mode before (according my CPU cores).
Does anyone have any ideas what could be causing this slow down issue and what I should do/debug to find the root cause of it? If i use Ubuntu 20.04 this issue never comes up with my scarthgap projects.
I started to look for some info about where could happen this slowdown effect in the bitbake lib.
In "self.rqdata.init_progress_reporter = bb.progress.MultiStageProcessProgressReporter( ... " i enabled the "debug = True" arg/flag for getting some info about the elapsed time of the "Initialising tasks" and i compared it in Ubuntu 22.04 and Ubuntu 20.04.
https://github.com/yoctoproject/poky/blob/scarthgap/bitbake/lib/bb/runqueue.py#L1565
Result is the following, i used my same ZynqMP Yocto project which released from scarthgap.
Ubuntu 22.04 LTS:
``` NOTE: Fetching uninative binary shim http://downloads.yoctoproject.org/releases/uninative/4.6/x86_64-nativesdk-libc-4.6.tar.xz;sha256sum=6bf00154c5a7bc48adbf63fd17684bb87eb07f4814fbb482a3fbd817c1ccf4c5 (will check PREMIRRORS first) Sstate summary: Wanted 2738 Local 0 Mirrors 0 Missed 2738 Current 0 (0% match, 0% complete)############################################################################################################## | ETA: 0:00:20 WARNING: Stage weights: [15, 16, 1, 4, 3, 4, 3, 4, 3, 3, 4, 3, 3, 221, 4, 6, 5, 3, 3, 5, 3, 17331, 4, 2, 4, 3, 82] WARNING: Stage times: Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:828: 15 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:925: 16 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1007: 1 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1054: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1095: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1103: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1120: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1127: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1227: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1228: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1241: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1258: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1271: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1574: 221 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1579: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1588: 6 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2930: 5 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2941: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2955: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2984: 5 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3009: 3 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3021: 17331 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3052: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3054: 2 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3072: 4 Up to /ssd/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3080: 3 Up to finish: 82 Initialising tasks: 100% |####################################################################################################################################################################################################| Time: 0:02:57 NOTE: Executing Tasks ```
Ubuntu 20.04 LTS:
``` NOTE: Fetching uninative binary shim http://downloads.yoctoproject.org/releases/uninative/4.6/x86_64-nativesdk-libc-4.6.tar.xz;sha256sum=6bf00154c5a7bc48adbf63fd17684bb87eb07f4814fbb482a3fbd817c1ccf4c5 (will check PREMIRRORS first) Sstate summary: Wanted 2738 Local 0 Mirrors 0 Missed 2738 Current 0 (0% match, 0% complete)############################################################################################################## | ETA: 0:00:00 WARNING: Stage weights: [10, 28, 2, 2, 1, 1, 1, 2, 3, 1, 1, 1, 1, 122, 7, 6, 4, 2, 2, 3, 1, 37, 2, 1, 1, 1, 96] WARNING: Stage times: Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:828: 10 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:925: 28 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1007: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1054: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1095: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1103: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1120: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1127: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1227: 3 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1228: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1241: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1258: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1271: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1574: 122 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1579: 7 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:1588: 6 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2930: 4 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2941: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2955: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:2984: 3 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3009: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3021: 37 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3052: 2 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3054: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3072: 1 Up to /Xilinx-Yocto/Zynq/sources/poky/bitbake/lib/bb/runqueue.py:3080: 1 Up to finish: 96 Initialising tasks: 100% |####################################################################################################################################################################################################| Time: 0:00:03 NOTE: Executing Tasks ```
Can somebody help and say more info about what does it mean that runqueue.py:3021 is much faster executed or reached in Ubuntu 20.04 then in 22.04?
https://github.com/yoctoproject/poky/blame/scarthgap/bitbake/lib/bb/runqueue.py#L3021
Before line 3021 runqueue.py code is really mature, there were no any change, except this in 2 years ago:
https://github.com/yoctoproject/poky/commit/b6e49784eac40a13b894839d17e89ef69a777a5d
Can it cause any speed issue in the complex while and for loop to seeking "unskippable" tasks?
Issue was solved with the following patch: https://lists.openembedded.org/g/bitbake-devel/topic/patch_bitbake_cooker_fix/110805862
Or need to disable Event log by using BB_DEFAULT_EVENTLOG = "" in local.conf file.